package com.book.system.service;

import com.book.system.common.R;
import com.book.system.service.impl.BookService;
import com.book.system.service.impl.BookServiceImpl;
import com.book.system.servlet.BaseServlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;


@WebServlet("/book")
public class BookServlet extends BaseServlet {
    /*
     *创建业务逻辑底层对象
     */
    private final BookService bookService=new BookServiceImpl();
   public R<List<Map<String,Object>>> getList(HttpServletRequest request, HttpServletResponse response){

       String name = request.getParameter("name");
       String classId = request.getParameter("classId");
       List<Map<String, Object>> list = bookService.getList(name, Integer.valueOf(classId));
       return R.success("数据获取成功",list);

   }


}

